<?php

/**
 * @author: zhangxingning
 * @contact: zhixiao476@gmail.com
 * @file: CodeDefine.php
 * @time: 2021/4/30 17:19
 * @desc:
 */
namespace App\Libraries;

class CodeDefine {

    /**
     * 各种状态码
     */
    const CODE_SUCCESS = 200;
    const CODE_UNAUTHORIZED = 401;
    const CODE_FORBIDDEN = 403;
    const CODE_NOT_FOUND = 404;
    const CODE_METHOD_NOT_ALLOWED = 405;
    const CODE_SERVICE_ERROR = 500;
    const CODE_CONN_NOT_ALLOW = 1000;

    const CODE_ERROR_NOT_FOUND = 1404;

    const CODE_ERROR_DEFAULT = 5000;
    const CODE_ERROR_PARAMS = 5001;
    const CODE_ERROR_RESULT = 5002;
    const CODE_ERROR_FORMAT = 5003;
    const CODE_FREQUENTLY = 5004;
    const CODE_ERROR_CALLSERVICE = 5005;
    const CODE_ROUTE_NOT_FOUND = 5006;
    const CODE_REQUEST_UNIQ = 5007;
    const CODE_ERROR_CREATE = 5008;
    const CODE_ERROR_UPDATE = 5009;
    const CODE_ERROR_FILE_SIZE = 5010;
    const CODE_ERROR_FILE_UPLOAD = 5011;


    // 用户状态码
    const CODE_ERROR_USER = 6000;
    const CODE_ERROR_PASS = 6001;


    public static $message = [
        self::CODE_SUCCESS => '成功',
        self::CODE_UNAUTHORIZED => '未认证',
        self::CODE_FORBIDDEN => '禁止访问',
        self::CODE_NOT_FOUND => '访问地址不存在',
        self::CODE_METHOD_NOT_ALLOWED => '访问方法错误',
        self::CODE_SERVICE_ERROR => '服务不可用',
        self::CODE_CONN_NOT_ALLOW => '连接不被允许',
        self::CODE_ERROR_DEFAULT => '调用接口异常',
        self::CODE_ERROR_PARAMS => '参数不正确',
        self::CODE_ERROR_RESULT => '返回结果不正确',
        self::CODE_ERROR_FORMAT => '格式不正确',
        self::CODE_FREQUENTLY => '访问频繁',
        self::CODE_ERROR_CALLSERVICE => '调用服务失败',
        self::CODE_ROUTE_NOT_FOUND => '服务路由没找到',
        self::CODE_REQUEST_UNIQ => '请求正在处理中',
        self::CODE_ERROR_CREATE => '创建失败',
        self::CODE_ERROR_UPDATE => '更新失败',
        self::CODE_ERROR_FILE_SIZE => '文件大小不能超过2M',
        self::CODE_ERROR_FILE_UPLOAD => '上传文件失败',

        self::CODE_ERROR_USER => '账号不正确',
        self::CODE_ERROR_PASS => '密码不正确'
    ];
}
